export default {
    // 复制功能
    copyText(t) {
		var text = t.toString();
		//#ifndef H5
		uni.setClipboardData({
			data: text,
			success: function() {
				uni.showToast({
					title: '复制成功',
					duration: 1500
				});
			}
		});
		// #endif
		//#ifdef H5
		const input = document.createElement("input");
		input.setAttribute("readonly", "readonly");
		input.setAttribute("value",text);
		document.body.appendChild(input);
		input.select();
		input.setSelectionRange(0, 9999);
		if (document.execCommand("copy")) {
		    document.execCommand("copy");
		    uni.showToast({
		    	title: '复制成功',
		    	duration: 1500
		    });
		}
		document.body.removeChild(input);
		// #endif
    }
}